---@class GT.tick 帧逻辑
---@field call any[] 回调
---@field time number 多久回调一次
tick = {}

---@alias tick_callback fun(uuid:Str):void

---@type table<uuid,tick_callback> 中心回调结构
tick.call = {}

---添加中心回调结构
---@param call tick_callback
---@return string id
function tick.add(call)
    local id = uuid()
    tick.call[id] = call
    return id
end

---删除中心回调结构
function tick.del(id)
    tick.call[id] = true
end

function OnTick(dt)
    for k, v in pairs(tick.call) do
        if type(v) == "boolean" then
            tick.call[k] = nil
        else
            v(k)
        end
    end
end
